<!DOCTYPE html>
<%
    request.setCharacterEncoding("UTF-8");
%>
<%@ page import="com.youtills.core.lang.StringUtil" %>
<%--
  Created by IntelliJ IDEA.
  User: ravic
  Date: 5/18/13
  Time: 3:40 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<%--@elvariable id="layout" type="com.youtills.core.app.common.SiteLayout"--%>
<%--@elvariable id="handler" type="com.youtills.core.app.pcc.PccEvRequestHandler"--%>
<html>
<head>
    <title>PCC-EV</title>
    <%--<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>--%>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/pcc.js"></script>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/pcc.css"/>
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
</head>
<body>
<table>
    <tr class="header"><td>
        <table>
            <tr >
                <td class="pcc">
                    Pleasanton Corporate Commons<br/>
                    EV Charging Stations
                </td>
                <c:choose>
                    <c:when test="${handler.evUser != null}">
                        <td class="user">${handler.evUser.userName}</td>
                    </c:when>
                    <c:otherwise>
                        <td>&nbsp;</td>
                    </c:otherwise>
                </c:choose>
            </tr>
        </table>
    </td></tr>

    <c:choose>
        <c:when test="${handler.evUser == null}">
            <tr>
                <td class="login">
                    <form action="pcc-ev" method="get">
                        Your Access Code:<input type="text" name="u"/>
                        <input type="submit" value="Submit"/>
                    </form>
                </td>
            </tr>
        </c:when>
        <c:otherwise>
            <tr><td>
                <table>
                    <tr>
                        <td class="station ${param.s == '6200' ? 'active' : ''}"><a  href="pcc-ev?s=6200">6200</a></td>
                        <td class="station ${param.s == '6210' ? 'active' : ''}"><a href="pcc-ev?s=6210">6210</a></td>
                        <td class="station ${param.s == '6220' ? 'active' : ''}"><a href="pcc-ev?s=6220">6220</a></td>
                        <td class="station ${param.s == '6230' ? 'active' : ''}"><a href="pcc-ev?s=6230">6230</a></td>
                    </tr>
                </table>
            </td></tr>

            <c:if test="${handler.station != null}">
                <tr><td>
                    <table>
                        <tr>
                            <c:set var="parking" value="${handler.station[0]}" scope="request"/>
                            <jsp:include page="pcc-parking.jsp" />

                            <c:set var="parking" value="${handler.station[1]}" scope="request"/>
                            <jsp:include page="pcc-parking.jsp" />
                        </tr>
                        <tr>
                            <c:set var="parking" value="${handler.station[2]}" scope="request"/>
                            <jsp:include page="pcc-parking.jsp" />

                            <c:set var="parking" value="${handler.station[3]}" scope="request"/>
                            <jsp:include page="pcc-parking.jsp" />
                        </tr>
                    </table>
                </td></tr>
            </c:if>
        </c:otherwise>
    </c:choose>
</table>
<footer>
    <%--PCC-Ev--%>
</footer>
</body>
</html>